<?php

/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| Here you may define all of your model factories. Model factories give
| you a convenient way to create models for testing and seeding your
| database. Just tell the factory how a default model should look.
|
*/
use Yangyifan\Administrator\Access\Model\Admin\Admin;
use Yangyifan\Library\Password;
use Yangyifan\BuildDom\Form\FormItem\Upload\Option\File;

/** @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(Admin::class, function (Faker\Generator $faker) {
    return [
        'user_name' => $faker->unique()->userName,
        'status' => mt_rand(1, 2),
        'password' => 123456,
        'mobile' => '138' . mt_rand(11111111, 88888888),
        'email'=>$faker->email,
        'avatar' => [(new File(['url' => 'http://ov2uat2y6.bkt.clouddn.com/3e02299703700735bf0136fab11de4f3.jpg']))->render()],
        'login_number' => 1,
        'last_login_ip' => ip2long($faker->ipv4),
    ];
});
